package edu.mit.media.fv.layers
{
	import edu.mit.media.fv.blocks.*;
	import edu.mit.media.fv.components.*;
	import edu.mit.media.fv.events.*;
	import edu.mit.media.fv.fluidspace.*;
	import edu.mit.media.fv.icons.*;
	
	import flash.display.DisplayObject;

	public class BackgroundLayer extends WorkspaceLayer
	{
		public function BackgroundLayer(volume:Number, x:int=0, y:int=0, width:int=650, height:int=100, name:String = "", color:uint = 0xFFFFFF, icon:DisplayObject = null)
		{
			super(volume, x, y, width, height, name, color, icon);
		}
		public override function dropBlock(block:Block):void{
			if(block.blockContainer == this){
				block.moveBlock(this);
				block.model.onAudioEdit(this.volume, (block.x/(this.layerWidth-block.diameter))*2-1);
			}else if(block.blockContainer is ActiveLayer){
				block.selfDestruct();
			}else{
				if(!block.model.hasAudio){
					block.snapBack();
				}else{
					block.moveBlock(this);
					block.model.onAudioEdit(this.volume, (block.x/(this.layerWidth-block.diameter))*2-1);
				}
			}
		}
		
	}
}